<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <img src="https://img-baofun.zhhainiao.com/market/133/2366564fa6b83158208eb3181752a8d6_preview.jpg" alt=""> -->
    <span>明</span>
    <span>天</span>
    <span>早</span>
    <span>上</span>
    <span>别</span>
    <span>迟</span>
    <span>到</span>
</body>
<script>

window.onload= function(){
    var spanObj = document.getElementsByTagName('span')
    var arr = ['darkgoldenrod','red','blue','green','yellow','pink','orange']
    setInterval(function(){
        var m = arr.pop() 
        arr.unshift(m)
        for(var i=0;i<spanObj.length;i++){
            spanObj[i].style.color = arr[i]
        }
    },100)
    
    // var arr = [
    //     "https://img-baofun.zhhainiao.com/market/133/3760b2031ff41ca0bd80bc7a8a13f7bb_preview.jpg",
    //     "https://img-baofun.zhhainiao.com/market/133/97ba6b60662ab4f31ef06cdf5a5f8e94_preview.jpg",
    //     "https://img-baofun.zhhainiao.com/market/133/a03f8b79f5b344c92855592f5b016cb0_preview.jpg",
    //     "https://img-baofun.zhhainiao.com/market/133/2366564fa6b83158208eb3181752a8d6_preview.jpg"],
    //     n = 0
    // setInterval(function(){
    //     document.getElementsByTagName("img")[0].src = arr[n++]
    //     n = n>3?0:n //三元表达式
    // },1000)
}

</script>
</html>